<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: Server Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__crypto__srv__functions.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Server Functions<div class="ingroups"><a class="el" href="group__group__crypto.html">Crypto       (Cryptography)</a> &raquo; <a class="el" href="group__group__crypto__cli__srv.html">Client-Server Model</a> &raquo; <a class="el" href="group__group__crypto__cli__srv__functions.html">Functions</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga1b6e8094edd6fa456da67f4b31ab754b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__srv__functions.html#ga1b6e8094edd6fa456da67f4b31ab754b">Cy_Crypto_Server_Start</a> (<a class="el" href="structcy__stc__crypto__config__t.html">cy_stc_crypto_config_t</a> const *config, <a class="el" href="structcy__stc__crypto__server__context__t.html">cy_stc_crypto_server_context_t</a> *context)</td></tr>
<tr class="memdesc:ga1b6e8094edd6fa456da67f4b31ab754b"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function starts the Full functionality for the Crypto server on the server side core, sets up an interrupt for the IPC Crypto channel, sets up an interrupt to catch Crypto HW errors.  <a href="#ga1b6e8094edd6fa456da67f4b31ab754b">More...</a><br /></td></tr>
<tr class="separator:ga1b6e8094edd6fa456da67f4b31ab754b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0b7269e7ff67b9bee97d393830fcd976"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__srv__functions.html#ga0b7269e7ff67b9bee97d393830fcd976">Cy_Crypto_Server_Stop</a> (void)</td></tr>
<tr class="memdesc:ga0b7269e7ff67b9bee97d393830fcd976"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function stops the Crypto server by disabling the IPC notify interrupt and Crypto error interrupt.  <a href="#ga0b7269e7ff67b9bee97d393830fcd976">More...</a><br /></td></tr>
<tr class="separator:ga0b7269e7ff67b9bee97d393830fcd976"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab3a5d2a4bd48f96e41d47117aabdfef6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__srv__functions.html#gab3a5d2a4bd48f96e41d47117aabdfef6">Cy_Crypto_Server_Process</a> (void)</td></tr>
<tr class="memdesc:gab3a5d2a4bd48f96e41d47117aabdfef6"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function parses input data received from the Crypto Client, runs the appropriate Crypto function and releases the Crypto IPC channel.  <a href="#gab3a5d2a4bd48f96e41d47117aabdfef6">More...</a><br /></td></tr>
<tr class="separator:gab3a5d2a4bd48f96e41d47117aabdfef6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga247aad529a2ad367f757c4b2aa1995da"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__srv__functions.html#ga247aad529a2ad367f757c4b2aa1995da">Cy_Crypto_Server_GetDataHandler</a> (void)</td></tr>
<tr class="memdesc:ga247aad529a2ad367f757c4b2aa1995da"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is a IPC Crypto channel notify interrupt-routine.  <a href="#ga247aad529a2ad367f757c4b2aa1995da">More...</a><br /></td></tr>
<tr class="separator:ga247aad529a2ad367f757c4b2aa1995da"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga36706e765604590078a2a55c6355b897"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__srv__functions.html#ga36706e765604590078a2a55c6355b897">Cy_Crypto_Server_ErrorHandler</a> (void)</td></tr>
<tr class="memdesc:ga36706e765604590078a2a55c6355b897"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is a routine to handle an interrupt caused by the Crypto hardware error.  <a href="#ga36706e765604590078a2a55c6355b897">More...</a><br /></td></tr>
<tr class="separator:ga36706e765604590078a2a55c6355b897"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga1b6e8094edd6fa456da67f4b31ab754b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1b6e8094edd6fa456da67f4b31ab754b">&#9670;&nbsp;</a></span>Cy_Crypto_Server_Start()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Server_Start </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__config__t.html">cy_stc_crypto_config_t</a> const *&#160;</td>
          <td class="paramname"><em>config</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__server__context__t.html">cy_stc_crypto_server_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function starts the Full functionality for the Crypto server on the server side core, sets up an interrupt for the IPC Crypto channel, sets up an interrupt to catch Crypto HW errors. </p>
<p>This function available for Server side only.</p>
<dl class="section note"><dt>Note</dt><dd>The Crypto server can be run as singleton (not multi-instance) application on the one of available cores at the same time.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">config</td><td>The Crypto configuration structure.</td></tr>
    <tr><td class="paramname">context</td><td>The pointer to the <a class="el" href="structcy__stc__crypto__server__context__t.html">cy_stc_crypto_server_context_t</a> structure that stores the Crypto server context.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a></dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: Configure Server and Client as follows:</span></div><div class="line"><span class="comment">     * Server:</span></div><div class="line"><span class="comment">     *  - IPC channel for communication: 9</span></div><div class="line"><span class="comment">     *  - IPC interrupt structure used for new request notifications: 1</span></div><div class="line"><span class="comment">     *  - Data request handler: default</span></div><div class="line"><span class="comment">     *  - Hardware errors handler: default</span></div><div class="line"><span class="comment">     * Client:</span></div><div class="line"><span class="comment">     *  - IPC channel for communication: 9</span></div><div class="line"><span class="comment">     *  - IPC interrupt structure used for data ready notifications: 2</span></div><div class="line"><span class="comment">     *  - Data Complete callback: not used</span></div><div class="line"><span class="comment">     */</span></div><div class="line"></div><div class="line"><span class="preprocessor">    #define MY_CHAN_CRYPTO         (uint32_t)(9u)    </span><span class="comment">/* IPC data channel for the Crypto */</span><span class="preprocessor"></span></div><div class="line"><span class="preprocessor">    #define MY_INTR_CRYPTO_SRV     (uint32_t)(1u)    </span><span class="comment">/* IPC interrupt structure for the Crypto server */</span><span class="preprocessor"></span></div><div class="line"><span class="preprocessor">    #define MY_INTR_CRYPTO_CLI     (uint32_t)(2u)    </span><span class="comment">/* IPC interrupt structure for the Crypto client */</span><span class="preprocessor"></span></div><div class="line"></div><div class="line"><span class="preprocessor">    #define MY_INTR_CRYPTO_SRV_MUX (IRQn_Type)(2u)   </span><span class="comment">/* CM0+ IPC interrupt mux number the Crypto server */</span><span class="preprocessor"></span></div><div class="line"><span class="preprocessor">    #define MY_INTR_CRYPTO_CLI_MUX (IRQn_Type)(3u)   </span><span class="comment">/* CM0+ IPC interrupt mux number the Crypto client */</span><span class="preprocessor"></span></div><div class="line"><span class="preprocessor">    #define MY_INTR_CRYPTO_ERR_MUX (IRQn_Type)(4u)   </span><span class="comment">/* CM0+ ERROR interrupt mux number the Crypto server */</span><span class="preprocessor"></span></div><div class="line"></div><div class="line">    <span class="keyword">const</span> <a class="code" href="structcy__stc__crypto__config__t.html">cy_stc_crypto_config_t</a> myCryptoConfig =</div><div class="line">    {</div><div class="line">        <span class="comment">/* .ipcChannel             */</span> MY_CHAN_CRYPTO,</div><div class="line">        <span class="comment">/* .acquireNotifierChannel */</span> MY_INTR_CRYPTO_SRV,</div><div class="line">        <span class="comment">/* .releaseNotifierChannel */</span> MY_INTR_CRYPTO_CLI,</div><div class="line"></div><div class="line">        <span class="comment">/* .releaseNotifierConfig */</span> {</div><div class="line"><span class="preprocessor">        #if (CY_CPU_CORTEX_M0P)</span></div><div class="line">            <span class="comment">/* .intrSrc            */</span> MY_INTR_CRYPTO_CLI_MUX,</div><div class="line">            <span class="comment">/* .cm0pSrc            */</span> cpuss_interrupts_ipc_2_IRQn, <span class="comment">/* depends on selected releaseNotifierChannel value */</span></div><div class="line"><span class="preprocessor">        #else</span></div><div class="line">            <span class="comment">/* .intrSrc            */</span> cpuss_interrupts_ipc_2_IRQn, <span class="comment">/* depends on selected releaseNotifierChannel value */</span></div><div class="line"><span class="preprocessor">        #endif</span></div><div class="line">            <span class="comment">/* .intrPriority       */</span> 2u,</div><div class="line">        },</div><div class="line"></div><div class="line">        <span class="comment">/* .userCompleteCallback   */</span> NULL,</div><div class="line">        <span class="comment">/* .userGetDataHandler     */</span> NULL,</div><div class="line">        <span class="comment">/* .userErrorHandler       */</span> NULL,</div><div class="line"></div><div class="line">        <span class="comment">/* .acquireNotifierConfig */</span> {</div><div class="line"><span class="preprocessor">        #if (CY_CPU_CORTEX_M0P)</span></div><div class="line">            <span class="comment">/* .intrSrc            */</span> MY_INTR_CRYPTO_SRV_MUX,      <span class="comment">/* to use with DeepSleep mode should be in DeepSleep capable muxer&#39;s range */</span></div><div class="line">            <span class="comment">/* .cm0pSrc            */</span> cpuss_interrupts_ipc_1_IRQn, <span class="comment">/* depends on selected acquireNotifierChannel value */</span></div><div class="line"><span class="preprocessor">        #else</span></div><div class="line">            <span class="comment">/* .intrSrc            */</span> cpuss_interrupts_ipc_1_IRQn, <span class="comment">/* depends on selected acquireNotifierChannel value */</span></div><div class="line"><span class="preprocessor">        #endif</span></div><div class="line">            <span class="comment">/* .intrPriority       */</span> 2u,</div><div class="line">        },</div><div class="line">        <span class="comment">/* .cryptoErrorIntrConfig */</span> {</div><div class="line"><span class="preprocessor">        #if (CY_CPU_CORTEX_M0P)</span></div><div class="line">            <span class="comment">/* .intrSrc            */</span> MY_INTR_CRYPTO_ERR_MUX,</div><div class="line">            <span class="comment">/* .cm0pSrc            */</span> cpuss_interrupt_crypto_IRQn,</div><div class="line"><span class="preprocessor">        #else</span></div><div class="line">            <span class="comment">/* .intrSrc            */</span> cpuss_interrupt_crypto_IRQn,</div><div class="line"><span class="preprocessor">        #endif</span></div><div class="line">            <span class="comment">/* .intrPriority       */</span> 2u,</div><div class="line">        }</div><div class="line">    };</div><div class="line"></div><div class="line">    <a class="code" href="structcy__stc__crypto__server__context__t.html">cy_stc_crypto_server_context_t</a>  myCryptoServerContext;</div><div class="line">    <a class="code" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>           cryptoStatus;</div><div class="line"></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__srv__functions.html#ga1b6e8094edd6fa456da67f4b31ab754b">Cy_Crypto_Server_Start</a>(&amp;myCryptoConfig, &amp;myCryptoServerContext);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga0b7269e7ff67b9bee97d393830fcd976"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0b7269e7ff67b9bee97d393830fcd976">&#9670;&nbsp;</a></span>Cy_Crypto_Server_Stop()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Server_Stop </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function stops the Crypto server by disabling the IPC notify interrupt and Crypto error interrupt. </p>
<p>This function available for Server side only.</p>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> </dd></dl>

</div>
</div>
<a id="gab3a5d2a4bd48f96e41d47117aabdfef6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab3a5d2a4bd48f96e41d47117aabdfef6">&#9670;&nbsp;</a></span>Cy_Crypto_Server_Process()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_Crypto_Server_Process </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function parses input data received from the Crypto Client, runs the appropriate Crypto function and releases the Crypto IPC channel. </p>
<p>This function available for Server side only.</p>
<dl class="section note"><dt>Note</dt><dd>This function should be used only when user register own GetDataHandler function. </dd></dl>

</div>
</div>
<a id="ga247aad529a2ad367f757c4b2aa1995da"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga247aad529a2ad367f757c4b2aa1995da">&#9670;&nbsp;</a></span>Cy_Crypto_Server_GetDataHandler()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_Crypto_Server_GetDataHandler </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is a IPC Crypto channel notify interrupt-routine. </p>
<p>It receives information from the Crypto client, runs the process if user not setup own handler.</p>
<p>This function available for Server side only. </p>

</div>
</div>
<a id="ga36706e765604590078a2a55c6355b897"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga36706e765604590078a2a55c6355b897">&#9670;&nbsp;</a></span>Cy_Crypto_Server_ErrorHandler()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_Crypto_Server_ErrorHandler </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is a routine to handle an interrupt caused by the Crypto hardware error. </p>
<p>This function available for Server side only. </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
